Directions to localize an application in QML:
=============================================

1. Wrap any string you want to translate in the QML with qsTr function
Ex: Button { text: qsTr("Hello") }

2. If your project path is:
C:\Users\sabbour\Work\Code\QtProjects\LocalizationDemo

And contains the following directories:
C:\Users\sabbour\Work\Code\QtProjects\LocalizationDemo\qml
C:\Users\sabbour\Work\Code\QtProjects\LocalizationDemo\qmlapplicationviewer
C:\Users\sabbour\Work\Code\QtProjects\LocalizationDemo\...

Create a subfolder in your project path called "i18n"
C:\Users\sabbour\Work\Code\QtProjects\LocalizationDemo\i18n

3. Open a Qt Command Prompt (You have to have the Qt Desktop target installed)
Start -> All Programs -> Qt SDK -> Desktop -> Qt 4.7.4 for Desktop (MinGW)

4. Type the following command
lupdate qml\ -ts i18n\translation_ar.ts

This parses your "qml" subfolder recursively and generates a translation file called "translation_ar.ts" in your i18n subdirectory. The "_ar" suffix indicates it is an Arabic translation.

5. Open the "translation_ar.ts" file in Qt Linguist (install it using Package Maintenance if it isn't installed)

6. Translate the strings using Qt Linguist

7. Release the strings by using File -> Release
You will find a "translation_ar.qm" file created in the "i18n" folder.

8. Add a Resource file, then add the "translation_ar.qm" under the "/" prefix.

9. Modify your main.cpp to include <QTranslator> and <QLocale> and "install" the translation file applicable to your desired locale, whether it comes from your application settings or it is dependant on the device locale.

10. Check the main.cpp file of the project to see how you should modify your code.